import 'package:dk_flutter_base/src/ui/widget/dk_app_bar.dart';
import 'package:flutter/material.dart';

class Person {
  String title;
  String content;

  Person(this.title, this.content);
}

class MainList extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return MainListSate();
  }
}

class MainListSate extends State<MainList> {
  final List<Person> list = List();

  @override
  void initState() {
    super.initState();
    for (int i = 0; i < 30; i++) {
      list.add(Person('标题$i', '内容$i'));
    }
  }

  @override
  Widget build(BuildContext context) {
    var listView = ListView.builder(
      itemCount: list.length,
      itemBuilder: (context, index) {
        return Container(
          height: 80,
          child: Text(list[index].title),
        );
      },
    );
    return Scaffold(
        appBar: AppBar(
          elevation: 0.0,
          title: InkWell(
            child: Text('我是主界面'),
            onTap: () {
              setState(() {
                list[8
                ].title = "哈哈哈哈";
              });
            },
          ),
        ),
        body: listView
//
        );
  }
}
